package day08demo1;

public class Demo3 {
    public static void main(String[] args) {
        int[][] arr = {
                {22, 33, 44},
                {55, 66, 77},
                {35, 45, 55},
                {24, 64, 42}
        };
        int number = 0;
        for (int i = 0; i < arr.length; i++) {
            int sum = getSum(arr[i]);
            number = number + getSum(arr[i]);
            System.out.print(sum + " ");
        }
        System.out.println();
        System.out.println(number);

    }

    public static int getSum(int[] arr) {
        int sum = 0;
        for (int i = 0; i < arr.length; i++) {
            sum = sum + arr[i];

        }
        return sum;
    }
}
